package com.lfg.leetcode.leetcode100;

public class Point {
    public int x;
    public int y;

    public Point() {
        x = 0;
        y = 0;
    }

    public Point(int a, int b) {
        x = a;
        y = b;
    }

    public static Point[] deserialize(String s) {
        s = s.substring(1, s.length() - 1);
        String[] array = s.split("\\],\\[");
        Point[] ret = new Point[array.length];
        for (int i = 0; i < array.length; i++) {
            String str = array[i];
            str = str.replaceAll("]", "").replaceAll("\\[", "");
            String[] content = str.split(",");
            ret[i] = new Point(Integer.valueOf(content[0]), Integer.valueOf(content[1]));
        }
        return ret;
    }
}